home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / programr / mathstud.zip / IFFT.M < prev    next >
Text File  |  1993-03-23  |  467b  |  29 lines

  1. function y=ifft(x,n)
  2. %y=ifft(x,n)
  3. %computes the inverse FFT of the input array, x
  4. %n specifies the size of the required transform
  5.  
  6. %       S.Halevy 7/31/92
  7. %       Copyright (c) 1992 by the MathWizards
  8.  
  9. if ~isvector(x)
  10.    error('input argument should be a vector')
  11. end
  12.  
  13. [xm,xn]=size(x);
  14. x=x(:);
  15.  
  16. if nargin > 1
  17.    nx = length(x);
  18.    if nx > n
  19.       x=x(1:n);
  20.    else
  21.       x(n)=0;
  22.    end
  23. end
  24.  
  25. y=_ifft(x)/length(x);
  26. if xn > xm
  27.    y=y.';
  28. end
  29.